import routs


class Decision:
    """
    Decision of what an icebreaker will do.
    """
    pass


class Move(Decision):
    """
    Move along an edge.

    Attributes:
        edge: Edge along which the icebreaker will move.
    """
    edge: routs.Edge

    def __init__(self, edge: routs.Edge):
        """
        Args:
            edge: Edge along which the icebreaker will move.
        """
        self.edge = edge

    def __str__(self):
        return f"{self.edge.node_start.name} --> {self.edge.node_end.name}"


class Attach(Decision):
    """
    Attach a transport ship for routing.

    Attributes:
        name: Name of the ship.
    """
    name: str

    def __init__(self, name: str):
        """
        Args:
            name: Name of the ship.
        """
        self.name = name

    def __str__(self):
        return f"{self.name}"


class Detach(Decision):
    """
    Detach the transport ship after routing.

    Attributes:
        name: Name of the ship.
    """
    name: str

    def __init__(self, name: str):
        """
        Args:
            name: Name of the ship.
        """
        self.name = name

    def __str__(self):
        return f"{self.name}"


class Program:
    """
    Sequence of decisions for an icebreaker.
    """
    decisions: list[Decision]

    def __init__(self):
        self.decisions = []

    def push_back(self, decision: Decision):
        self.decisions.append(decision)

    def pop_front(self):
        self.decisions.pop(0)
